#ifndef ITEM_HH
#define ITEM_HH
/*
The Item class represents game items with properties like name, description, stat boosts (health/attack/defense),
and type (e.g., equipment, consumables), providing item initialization, accessors for attributes, 
a use() method to trigger type-specific actions (e.g., healing for consumables, skill grants for scrolls,
or inventory addition for equipment), a clone() function for deep-copying items (marking ownership),
and predefined equipment instances with fixed stat bonuses (e.g., LuckyCharm, RustyRing).
*/
/* 
* Item类表征游戏道具系统，包含以下要素：
* - 基础属性：名称、描述、属性加成（生命/攻击/防御）
* - 类型区分：装备类、消耗品类等
* 提供：
* 1. 道具初始化功能
* 2. 属性访问器
* 3. use()方法触发类型专属操作：
*   - 消耗品：治疗效果
*   - 卷轴：技能授予
*   - 装备：存入背包
* 4. clone()深拷贝函数（标记所有权）
* 5. 预定义装备实例（固定属性加成）：
*   - 幸运护符(LuckyCharm)
*   - 锈蚀指环(RustyRing)
*/
#include <string>
#include "Skill.hh"

namespace DungeonRPG{

class Character;
class Skill; 
enum class ItemType {
    Equipment,
    Food,
    Bandage,
    HolyWater,
    Torch,
    Scroll
};

class Item {
public:
   
    Skill* specialSkill = nullptr;  
    Item(const std::string& name,
         const std::string& description,
         int healthBoost,
         int attackBoost,
         int defenseBoost,
         ItemType type);

    virtual bool use(Character* target);

    virtual Item* clone() const;
    bool ownedByRoom = true;
    std::string getName() const;
    std::string getDescription() const;


    virtual ~Item() = default;


    std::string name;
    std::string description;
    int healthBoost;
    int attackBoost;
    int defenseBoost;
    ItemType type;
};


extern  Item LuckyCharm;
extern  Item RustyRing;
extern  Item SharpTrinket;
extern  Item HeavyPendant;
extern  Item VirtueBadge;
extern  Item BloodCharm;
extern  Item OccultNecklace;

}

#endif
